package com.zhang.producer;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.function.Supplier;

/**
 * @Package: com.example.streamdemo.consumer
 * @ClassName: FunctionConsumer
 * @Author: Think
 * @CreateTime: 2021/7/17 9:10
 * @Description:
 */
@Slf4j
@Component
public class FunctionProducer {

    @Bean
    public Supplier<Date> mySource(){
        return () -> {
            log.info("当前发送消息开始！");
            return new Date();
        };
    }

}
